package com.dajiba.demo;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;

import androidx.annotation.Nullable;

public class CustomDrawPath extends BaseCustomView {

    public CustomDrawPath(Context context) {
        super(context);
    }

    public CustomDrawPath(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomDrawPath(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Path path = new Path();
        path.addArc(200, 200, 400, 400, -225, 225);
        path.arcTo(400, 200, 600, 400, -180, 225, false);
        path.lineTo(400, 542);

        RectF rectF = new RectF(100, 800, 500, 1200);
        path.addArc(rectF,150,200);
        path.lineTo(500,1500);
//        path.lineTo(300,600);
        path.addArc(new RectF(490, 800, 890, 1200),190,200);
        path.lineTo(500,1500);
        canvas.drawPath(path,mPaint);
    }
}
